//
//  SWPictureItemView.swift
//  SinaWeibo
//
//  Created by wszyxc on 16/7/25.
//  Copyright © 2016年 wszyxc. All rights reserved.
//

import UIKit

class SWPictureCell: UICollectionViewCell{

    
    var picModel:SWPictureModel?{
        
        didSet{
            
            picImageView.sd_setImageWithURL(NSURL(string: (picModel?.thumbnail_pic)!))
        }
        
    }
    

   override init(frame: CGRect) {
        super.init(frame: frame)
        
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    private func setupUI(){
        
        addSubview(picImageView)
        
        picImageView.snp_makeConstraints { (make) -> Void in
            
            make.edges.equalTo(UIEdgeInsetsZero)
            
        }
        
        //设置图片正好覆盖住相框(最小边正好等于相框)
        picImageView.contentMode = .ScaleAspectFill
        
        picImageView.layer.masksToBounds = true
        
    }
    
    private lazy var picImageView:UIImageView = UIImageView()
    

}
